local function main(userOb, msgData)
    local rpc = {}
    local userId = userOb:query_temp("userId")
    
    rpc.behavior = "get"
    rpc.method = "ranking"
    rpc.from_user = userId

    local ok, data = THREAD_D:send("database_yield", rpc) 
    local result = {}
    if #data > 0 then
       result.data = table.values(data)   
    else
       result.data = {} 
    end    
    result.code = 200
    result.status = "success"
    userOb:send_packet("MSGC2SGETFRIENDS", result)  

end

--注册方法
COMMAND_D:register_command("MSGC2SGETFRIENDS",GameCmdType.NONE, main)